load("@rules_proto//proto:defs.bzl", "proto_library")
load("@io_bazel_rules_go//go:def.bzl", "go_library")
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")

proto_library(
    name = "grpcutils_proto",
    srcs = ["testservice.proto"],
    strip_import_prefix = "/pkg",
    visibility = ["//visibility:public"],
    deps = ["@com_google_protobuf//:any_proto"],
)

go_proto_library(
    name = "grpcutils_go_proto",
    compilers = ["//pkg/cmd/protoc-gen-gogoroach:protoc-gen-gogoroach_grpc_compiler"],
    importpath = "github.com/cockroachdb/cockroach/pkg/testutils/grpcutils",
    proto = ":grpcutils_proto",
    visibility = ["//visibility:public"],
)

go_library(
    name = "grpcutils",
    testonly = 1,
    srcs = ["testserver.go"],
    embed = [":grpcutils_go_proto"],
    importpath = "github.com/cockroachdb/cockroach/pkg/testutils/grpcutils",
    visibility = ["//visibility:public"],
    deps = ["@com_github_gogo_protobuf//types"],
)
